package cn.net.mysoft.account.api.common;

public class VnoProvider {
    private static VnoProvider instance = null;

    private VnoProvider(){
        curent = MIN;
    }

    public static VnoProvider getInstance(){
        if (instance == null) {
            instance = new VnoProvider();
        }
        return instance;
    }

    private long curent;
    private final long MIN = 1L;

    public synchronized  long getAsLong(){
        long MAX = 10000000L;
        curent = curent>= MAX ?MIN:++curent;
        return curent;
    }

    public  String getAsString(){
        return String.valueOf(getAsLong());
    }

    public String getUniqueString(){
        return System.currentTimeMillis() +"_"+getAsString();
    }
    public String getUniqueString(String prefix){
        return prefix + System.currentTimeMillis() + "_" + getAsString();
    }

}
